SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE PROCEDURE dbo.DnnProduct_DeleteFolderPermissionsByFolderPath
	@PortalID int,
	@FolderPath nvarchar(300)
AS
DECLARE @FolderID int
SELECT @FolderID = FolderID FROM dbo.DnnProduct_Folders
WHERE FolderPath = @FolderPath
AND ((PortalID = @PortalID) or (PortalID is null and @PortalID is null))

DELETE FROM dbo.DnnProduct_FolderPermission
WHERE
	[FolderID] = @FolderID

GO
